
<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName"
           value="${message(code: 'workflowInstanceUser.label', default: 'workflowInstanceUser')}"/>

    <title>新增工作流消息</title>
    <asset:stylesheet src="homer/vendor/codemirror/codemirror.css"/>

</head>

<body>

<div class="main-body">
    <div class="page-wrapper">
        <!-- Page-header start -->
        <div class="page-header">
            <div class="page-header-title">
                <h4>新增工作流消息</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <g:link controller="workflowInstanceStage" action="show"
                                id="${this.workflowInstanceNotification?.stage?.id}">工作流阶段</g:link>
                    </li>
                    <li class="breadcrumb-item"><a href="#!">新增工作流消息</a>
                    </li>
                </ul>
            </div>
        </div>
        <!-- Page-header end -->
        <!-- Page-body start -->
        <div class="page-body">

            <g:if test="${flash.message}">
                <div class="message alert alert-info" role="status">${flash.message}
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                            aria-hidden="true">×</span></button>
                </div>
            </g:if>
        <g:hasErrors bean="${this.workflowInstanceNotification}">
            <ul class="errors" role="alert">
                <g:eachError bean="${this.workflowInstanceNotification}" var="error">
                    <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
                            error="${error}"/></li>
                </g:eachError>
            </ul>
        </g:hasErrors>
        <!-- Hover table card start -->
            <div class="card">
                <div class="card-header">
                    <h5>新增工作流消息</h5>

                    <div class="card-header-right">

                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>

                <div class="card-block">
                    <g:form action="save" class="form-horizontal">
                      
                        <div class="form-group row">
                            <label class="col-md-3 control-label">用户</label>

                            <div class="col-md-4">
                                <input type="hidden" name="stage.id"
                                       value="${this.workflowInstanceNotification?.stage?.id}">
                                <g:select class="form-control" name="user.id" id="user"
                                          value="${this.workflowInstanceNotification?.user?.id}"
                                          from="${this.userList}" optionKey="id" noSelection="['': '-请选择-']"></g:select>

                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-3 control-label">消息模板</label>

                            <div class="col-md-4">
                                <g:select class="form-control" name="messageTemplate.id" required="required"
                                          id="messageTemplate"
                                          value="${this.workflowInstanceNotification?.messageTemplate}"
                                          from="${com.next.MessageTemplate.list()}" optionKey="id"></g:select>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-3 control-label">推送主管</label>
                            <div class="col-md-4 border-checkbox-section">
                                <div class="border-checkbox-group border-checkbox-group-primary form-control-static">
                                    <g:checkBox class="border-checkbox" name="toManager" id="checkbox0"
                                                value="${this.workflowInstanceEvent?.toManager}"/>
                                    <label class="border-checkbox-label" for="checkbox0"></label>
                                </div>

                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-3 control-label">手机号</label>

                            <div class="col-md-6">

                                <g:textArea name="cellphone" id="code1"
                                            value="${this.workflowInstanceNotification?.cellphone}"
                                            class="form-control textarea"
                                            rows="25" cols="15"/>

                            </div>
                        </div>


                        <div class="form-group row">
                            <div class="col-md-12">
                                <button class="submitBtn btn btn-info" type="submit">保存</button>
                            </div>
                        </div>
                    </g:form>
                </div>
            </div>
            <!-- Hover table card end -->
        </div>

        <!-- Page-body end -->

    </div>
</div>
<asset:javascript src="homer/vendor/codemirror/codemirror.js"/>
%{-- <asset:javascript src="homer/vendor/codemirror/javascript.js"/> --}%


<script>
    $(document).ready(function () {
        var textarea1 = document.getElementById("code1");
        var editor1 = CodeMirror.fromTextArea(textarea1, {
            lineNumbers: false,
            matchBrackets: true,
            styleActiveLine: true
        });

        $(".submitBtn").click(function () {
            $("#code1").val(editor1.getValue());
        });
    });
</script>
</body>

</html>


